/**
 *  (c)
 * <p>
 *
 * <p>
 *
 */

package com.nn.smart.bus.service;

import com.nn.smart.bus.common.token.dto.WorkUserAuthorizationDTO;
import com.nn.smart.bus.common.token.dto.WorkUserAuthorizationScripDTO;
import com.nn.smart.bus.dto.AuthorizationDTO;
import com.nn.smart.bus.dto.LoginDTO;
import com.nn.smart.bus.commons.tools.utils.Result;
import com.nn.smart.bus.dto.DataScopeDeptList;
import com.nn.smart.bus.dto.SysUserOpenIdFormDTO;

import java.util.List;

/**
 * 认证服务
 *
 * @author nanning
 * @since 1.0.0
 */
public interface AuthService {

    /**
     * 登录
     */
    AuthorizationDTO login(LoginDTO login);

    /**
     *
     * 工作端登录
     *
     * @params [username, password]
     * @return com.nn.smart.bus.commons.tools.utils.Result<com.nn.smart.bus.common.token.dto.WorkUserAuthorizationDTO>
     * @author nanning
     * @since 2019/11/20 9:30
     */
    Result<WorkUserAuthorizationDTO> workLogin(String username, String password);

    /**
     *
     * 根据用户名更新用户微信openId
     *
     * @params [sysUserOpenIdFormDto]
     * @return com.nn.smart.bus.commons.tools.utils.Result
     * @author nanning
     * @since 2019/11/20 9:50
     */
    Result modifyOpenId(SysUserOpenIdFormDTO sysUserOpenIdFormDto);

    /**
     * 退出
     */
    void logout(Long userId);

    /**
     *
     * 获取用户所有角色权限信息
     *
     * @params [id]
     * @return java.util.List<com.nn.smart.bus.dto.DataScopeDeptList>
     * @author nanning
     * @since 2019/11/19 23:42
     */
    List<DataScopeDeptList> getDataScopeDetailList(Long id);

    /**
     * 退出
     */
    Result logoutUser(Long userId);

    /**
     * @Description  用户凭证登录
     * @author nanning
     * @Date  2020/6/22
     * @Param [scrip]
     * @return com.nn.smart.bus.commons.tools.utils.Result<com.nn.smart.bus.common.token.dto.WorkUserAuthorizationDTO>
     **/
    Result<WorkUserAuthorizationScripDTO> workScripLogin(String scrip);
}
